<template>
  <div class="home-hot">
    <HomePanel title="人气推荐" sub-title="人气爆款 不容错过">
      <div ref="target" style="position: relative;height: 426px;">
        <!-- 面板内容 -->
        <transition name="fade">
          <ul v-if="list.length" class="goods-list">
            <li v-for="item in list" :key="item.id">
              <RouterLink to="/">
                <img v-lazy="item.picture" alt="">
                <p class="name">{{ item.title }}</p>
                <p class="desc">{{ item.alt }}</p>
              </RouterLink>
            </li>
          </ul>
          <home-skeleton v-else />
        </transition>
      </div>
    </HomePanel>
  </div>
</template>
<script setup >
import HomePanel from './home-panel.vue';
import Home from '@/api/modules/home';
import HomeSkeleton from './home-skeleton.vue';
import { useLazyData } from "@/hooks/index"
const { result: list, target } = useLazyData(Home.hotList)

</script>
<style scoped lang="less">
.home-hot {
  .home-good-list()
}
</style>
